export const loadImage = (src) => {
    return new Promise(function (resolve, reject) {
        let img = new Image();
        img.onload = function () {
            resolve(img);//加载时执行resolve函数
        }
        img.onerror = function () {
            reject(src + '这个地址错误');//抛出异常时执行reject函数
        }
        img.src = src;
    })
}
